package org.mspring.platform.weibo.tencent.dao.impl;

import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.mspring.platform.dao.hibernate.GenericDao;
import org.mspring.platform.weibo.tencent.dao.TencentUserinfoDao;
import org.mspring.platform.weibo.tencent.entity.TencentUserinfo;
import org.springframework.stereotype.Repository;

/**
 *
 * @author Gao Youbo
 * @since 2014年5月19日
 */
@Repository
public class TencentUserinfoDaoImpl extends GenericDao<TencentUserinfo, Long> implements TencentUserinfoDao {

    @Override
    public void initTable() throws IOException {
        try (InputStream is = getClass().getResourceAsStream("/t_tencent_userinfo.sql")) {
            String sql = IOUtils.toString(is, "UTF-8");
            getJdbcTemplate().execute(sql);
        }
    }

}
